home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-01-19 | 6.4 KB | 240 lines |
- /**
- *
- * You can add code anywhere in this file - except in the areas that are
- * written by the editor. You should not change the relative ordering of
- * the code.
- *
- * You can remove this comment block or replace it with another.
- *
- * @see
- * @version
- * @author
- */
-
-
- import com.supercede.forms.*;
- import java.util.*;
- import java.net.*;
- import java.io.*;
- import java.beans.*;
- import java.awt.event.*;
- import java.awt.*;
-
- public class Form1 extends SuperCedeFrame implements Serializable
- {
-
- public Form1() throws IOException, ClassNotFoundException, ClassCastException, SuperCedeInvalidStateException
- {
- SuperCedeConstructor(); // Do not remove this line.
- }
-
- public static void main(String args[])
- {
- // You can add code anywhere in this method.
-
- try
- {
- Form1 app = new Form1();
- app.setVisible(true);
- }
- catch(Throwable t)
- {
- System.out.println("Cannot construct the form: " + t);
- System.exit(1);
- }
- }
-
- public void form1WindowClosing(WindowEvent e)
- {
- // You can add code anywhere in this method.
-
- dispose();
- }
-
- public void form1WindowClosed(WindowEvent e)
- {
- // You can add code anywhere in this method.
-
- SuperCedeWindowClosed();
- }
- void updateColor()
- {
- Color c = new Color( redScroll.getValue(),
- greenScroll.getValue(),
- blueScroll.getValue());
- myCanvas.setBackground(c);
- }
- public void redScrollAdjustmentValueChanged(AdjustmentEvent arg0)
- {
- // Put event handler code here...
- updateColor();
- }
-
- public void blueScrollAdjustmentValueChanged(AdjustmentEvent arg0)
- {
- // Put event handler code here...
- updateColor();
- }
-
- public void greenScrollAdjustmentValueChanged(AdjustmentEvent arg0)
- {
- // Put event handler code here...
- updateColor();
- }
-
- // SuperCede Begin 2.0 Form Members
- // Do not remove the Begin and End markers.
- // The editor will rewrite the contents of this section each time the form is saved.
-
- // References to Beans within the Form.
-
- Canvas myCanvas;
- com.supercede.beans.stdawt.ScrollbarH redScroll;
- com.supercede.beans.stdawt.ScrollbarH greenScroll;
- com.supercede.beans.stdawt.ScrollbarH blueScroll;
-
- private final void SuperCedeConstructor() throws IOException, ClassNotFoundException, ClassCastException, SuperCedeInvalidStateException
- {
- // Construct the actual connectors to give to our base class.
-
- Vector connectors = new Vector(5);
- connectors.addElement(new Form1WindowClosingConnector0());
- connectors.addElement(new Form1WindowClosedConnector1());
- connectors.addElement(new Form1EventConnector2());
- connectors.addElement(new Form1EventConnector3());
- connectors.addElement(new Form1EventConnector4());
-
- super.initializeThis(connectors);
-
- // Make references to Beans within the Form.
-
- int i = 0;
-
- myCanvas = (Canvas) getComponent(i++);
- redScroll = (com.supercede.beans.stdawt.ScrollbarH) getComponent(i++);
- greenScroll = (com.supercede.beans.stdawt.ScrollbarH) getComponent(i++);
- blueScroll = (com.supercede.beans.stdawt.ScrollbarH) getComponent(i++);
- }
-
- private final void SuperCedeWindowClosed()
- {
- System.exit(0);
- }
-
- // SuperCede End 2.0 Form Members
- }
-
- // SuperCede Begin 2.0 Form Connectors
- // Do not remove the Begin and End markers.
- // The editor will rewrite the contents of this section each time the form is saved.
-
- // Connections for this Form:
- // Form1WindowClosingConnector0: from Form1.windowClosing to Form1.form1WindowClosing
- // Form1WindowClosedConnector1: from Form1.windowClosed to Form1.form1WindowClosed
- // Form1EventConnector2: from com.supercede.beans.stdawt.ScrollbarH.adjustmentValueChanged to Form1.redScrollAdjustmentValueChanged
- // Form1EventConnector3: from com.supercede.beans.stdawt.ScrollbarH.adjustmentValueChanged to Form1.greenScrollAdjustmentValueChanged
- // Form1EventConnector4: from com.supercede.beans.stdawt.ScrollbarH.adjustmentValueChanged to Form1.blueScrollAdjustmentValueChanged
-
- final class Form1WindowClosingConnector0 extends WindowAdapter implements SuperCedeConnector
- {
- private Form1 windowClosingTarget;
-
- public void setWindowClosingTarget(Form1 target)
- {
- windowClosingTarget = target;
- }
-
- public void windowClosing(WindowEvent arg0)
- {
- windowClosingTarget.form1WindowClosing(arg0);
- }
-
- public void setTarget(Object target)
- {
- setWindowClosingTarget((Form1) target);
- }
- }
-
- final class Form1WindowClosedConnector1 extends WindowAdapter implements SuperCedeConnector
- {
- private Form1 windowClosedTarget;
-
- public void setWindowClosedTarget(Form1 target)
- {
- windowClosedTarget = target;
- }
-
- public void windowClosed(WindowEvent arg0)
- {
- windowClosedTarget.form1WindowClosed(arg0);
- }
-
- public void setTarget(Object target)
- {
- setWindowClosedTarget((Form1) target);
- }
- }
-
- final class Form1EventConnector2 implements SuperCedeConnector, java.awt.event.AdjustmentListener
- {
- private Form1 adjustmentValueChangedTarget;
-
- public void setAdjustmentValueChangedTarget(Form1 target)
- {
- adjustmentValueChangedTarget = target;
- }
-
- public void adjustmentValueChanged(AdjustmentEvent arg0)
- {
- adjustmentValueChangedTarget.redScrollAdjustmentValueChanged(arg0);
- }
-
- public void setTarget(Object target)
- {
- setAdjustmentValueChangedTarget((Form1) target);
- }
- }
-
- final class Form1EventConnector3 implements SuperCedeConnector, java.awt.event.AdjustmentListener
- {
- private Form1 adjustmentValueChangedTarget;
-
- public void setAdjustmentValueChangedTarget(Form1 target)
- {
- adjustmentValueChangedTarget = target;
- }
-
- public void adjustmentValueChanged(AdjustmentEvent arg0)
- {
- adjustmentValueChangedTarget.greenScrollAdjustmentValueChanged(arg0);
- }
-
- public void setTarget(Object target)
- {
- setAdjustmentValueChangedTarget((Form1) target);
- }
- }
-
- final class Form1EventConnector4 implements SuperCedeConnector, java.awt.event.AdjustmentListener
- {
- private Form1 adjustmentValueChangedTarget;
-
- public void setAdjustmentValueChangedTarget(Form1 target)
- {
- adjustmentValueChangedTarget = target;
- }
-
- public void adjustmentValueChanged(AdjustmentEvent arg0)
- {
- adjustmentValueChangedTarget.blueScrollAdjustmentValueChanged(arg0);
- }
-
- public void setTarget(Object target)
- {
- setAdjustmentValueChangedTarget((Form1) target);
- }
- }
-
- // The following line must be the last line in the file.
- // SuperCede End 2.0 Form Connectors
-